package com.wildwolf.project.wildwolf.ui;

import com.wildwolf.project.wildwolf.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;

public class WelCome  extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
        // 取消标题， 
        this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
        // 取消状态栏 
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN); 
        this.setContentView(R.layout.welcome); 
        ImageView iv = (ImageView) this.findViewById(R.id.log_as_logo);

       //设置图片动画效果

        AlphaAnimation aa = new AlphaAnimation(0.1f, 1.0f); 
        aa.setDuration(3000); 
        iv.startAnimation(aa);

        //内部匿名类实现动画监听，重写三个事件，我们关心的时最后一个 
        aa.setAnimationListener(new AnimationListener() 
        { 
            @Override 
            public void onAnimationStart(Animation animation) 
            { 
            }

            @Override 
            public void onAnimationRepeat(Animation animation) 
            { 
            }

            //动画结束后，跳转到登录界面

            @Override 
            public void onAnimationEnd(Animation animation) 
            { 
                Intent it = new Intent(WelCome.this, Login.class); 
                startActivity(it); 
            } 
        }); 
	}

}
